package com.xingda.packing.dmds.task.listener;

import com.xingda.packing.dmds.domain.PackProductionLine;
import com.xingda.packing.dmds.enums.TaskState;
import com.xingda.packing.dmds.enums.TaskType;
import com.xingda.packing.dmds.task.ticket.AbstractTaskTicket;

public interface TaskListenerService {

    boolean accept(PackProductionLine productionLine, int area);

    void monitor(PackProductionLine productionLine, int area);

    default boolean checkTask(AbstractTaskTicket ticket, TaskType taskType) {
        return ticket != null && ticket.getType() == taskType && ticket.getState() == TaskState.RUNING;
    }
}
